package com.summer.JUnit;

import com.summer.JUnit.MyStack.InvariantException;

import junit.framework.TestCase;

public class TestMyStack extends TestCase {

	public void testEmpty() throws InvariantException{
		MyStack stack = new MyStack();
		stack.checkInvariant();
		stack.push("sample");
		stack.checkInvariant();
		
		//Popping last element ok
		assertEquals("sample", stack.pop());
		stack.checkInvariant();
		
		//Delete from empty stack
		stack.delete(1);
		stack.checkInvariant();
		
	}
	
}
